<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
<!-- bootstrap-css -->
<link rel="stylesheet" href="css/bootstrap.min.css" >
<!-- //bootstrap-css -->
<!-- Custom CSS -->
<link href="css/style.css" rel='stylesheet' type='text/css' />
<link href="css/style-responsive.css" rel="stylesheet"/>
<!-- font-awesome icons -->
<link rel="stylesheet" href="css/font.css" type="text/css"/>
<link href="css/font-awesome.css" rel="stylesheet"> 
<!-- //font-awesome icons -->
<script src="js/jquery2.0.3.min.js"></script>
</head>
<body>
<div class="log-w3">
<div class="w3layouts-main">
	<h2>卓越项目管理系统</h2>
		
			<input type="text" class="ggg" name="uname" id="uname" placeholder="管理员">
			<input type="password" class="ggg" name="upswd" id="exampleInputPassword1" placeholder="密码" >
			<span><input type="radio" name="a" value="gm"/>我是管理员</span>
			<span><input type="radio" name="a" value="yu"/>我是员工</span>
			
				
				<input type="button" onclick="de()" id="ad" value="登  录" name="login">
		
		
</div>
</div>
<script src="js/bootstrap.js"></script>
<script src="js/jquery.dcjqaccordion.2.7.js"></script>
<script src="js/scripts.js"></script>
<script src="js/jquery.slimscroll.js"></script>
<script src="js/jquery.nicescroll.js"></script>
<!--[if lte IE 8]><script language="javascript" type="text/javascript" src="js/flot-chart/excanvas.min.js"></script><![endif]-->
<script src="js/jquery.scrollTo.js"></script>
<script src="/Excellence-Project/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript">
function de(){
	
     var uname=$("#uname").val();
     var upswd=$("#password").val();

    var item = $('input[name=a]:checked').val();
    console.log(item);
	
    if(item=="gm"){
    	$.ajax({
    		type:"post",
    	    url:"d",
    	    data:{
    	    	"uname":uname,
    	    	"upswd":upswd
    	    },
    	    success:function(data){
    		console.log(data);
    		var uname=$("#uname").val();
    	    var upswd=$("#password").val();
    	    
    		alert("登录成功")
    		localStorage.setItem("a",uname);
    		location.href="d2";
    		
    	},
    	    error:function(error){
    		console.log(error);
    		alert("登录失败")
    	}
    	})  
    }else{
    	$.ajax({
    		type:"post",
    	    url:"yd",
    	    data:{
    	    	"pName":uname,
    	    	"pPswd":upswd
    	    },
    	    success:function(data){
    		console.log(data);
    		var uname=$("#uname").val();
    	    var upswd=$("#password").val();
    	    
    		alert("登录成功")
    		localStorage.setItem("a",uname);
    		location.href="yd2";
    		
    	},
    	    error:function(error){
    		console.log(error);
    		alert("登录失败")
    	}
    	})  
    }
	  
}	
</script>
</body>
</html>